Developer Documentation

QuickTime 4 API Documentation

3D Graphics Programming with QuickDraw 3D 1.5.4

Previous | QD3D Book | Overview | Chapter Contents | Next |

Determining Point Relative Ratios

QuickDraw 3D provides routines that you can use to determine point-relative ratios between two points. These routines return a point on the line segment defined by those two points that is at a desired distance from the first point.

Q3Point2D_RRatio

You can use the Q3Point2D_RRatio function to find a point lying between two given two-dimensional points that is at a desired distance ratio from one of those points.

TQ3Point2D *Q3Point2D_RRatio (
                     const TQ3Point2D *p1,
                     const TQ3Point2D *p2,
                     float r1,
                     float r2,
                     TQ3Point2D *result);
p1
A two-dimensional point.
p2
A two-dimensional point.
r1
A floating-point number.
r2
A floating-point number.
result
On exit, the two-dimensional point that is at a desired distance ratio from p1 along the line segment between p1 and p2 .

DESCRIPTION

The Q3Point2D_RRatio function returns, as its function result and in the result parameter, the two-dimensional point that lies on the line segment between the points p1 and p2 and that is at a distance from the first point determined by the ratio r1 /( r1 + r2 ).

Q3Param2D_RRatio

You can use the Q3Param2D_RRatio function to find a point lying between two given two-dimensional parametric points that is at a desired distance ratio from one of those points.

TQ3Param2D *Q3Param2D_RRatio (
                     const TQ3Param2D *p1,
                     const TQ3Param2D *p2,
                     float r1,
                     float r2,
                     TQ3Param2D *result);
p1
A two-dimensional parametric point.
p2
A two-dimensional parametric point.
r1
A floating-point number.
r2
A floating-point number.
result
On exit, the two-dimensional parametric point that is at a desired distance ratio from p1 along the line segment between p1 and p2 .

DESCRIPTION

The Q3Param2D_RRatio function returns, as its function result and in the result parameter, the two-dimensional parametric point that lies on the line segment between the points p1 and p2 and that is at a distance from the first parametric point determined by the ratio r1 /( r1 + r2 ).

Q3Point3D_RRatio

You can use the Q3Point3D_RRatio function to find a point lying between two given three-dimensional points that is at a desired distance ratio from one of those points.

TQ3Point3D *Q3Point3D_RRatio (
                     const TQ3Point3D *p1,
                     const TQ3Point3D *p2,
                     float r1,
                     float r2,
                     TQ3Point3D *result);
p1
A three-dimensional point.
p2
A three-dimensional point.
r1
A floating-point number.
r2
A floating-point number.
result
On exit, the three-dimensional point that is at a desired distance ratio from p1 along the line segment between p1 and p2 .

DESCRIPTION

The Q3Point3D_RRatio function returns, as its function result and in the result parameter, the three-dimensional point that lies on the line segment between the points p1 and p2 and that is at a distance from the first point determined by the ratio r1 /( r1 + r2 ).

Q3RationalPoint4D_RRatio

You can use the Q3RationalPoint4D_RRatio function to find a point lying between two given four-dimensional points that is at a desired distance ratio from one of those points.

TQ3RationalPoint4D *Q3RationalPoint4D_RRatio (
                     const TQ3RationalPoint4D *p1,
                     const TQ3RationalPoint4D *p2,
                     float r1,
                     float r2,
                     TQ3RationalPoint4D *result);
p1
A rational four-dimensional point.
p2
A rational four-dimensional point.
r1
A floating-point number.
r2
A floating-point number.
result
On exit, the four-dimensional point that is at a desired distance ratio from p1 along the line segment between p1 and p2 .

DESCRIPTION

The Q3RationalPoint4D_RRatio function returns, as its function result and in the result parameter, the four-dimensional point that lies on the line segment lying between the points p1 and p2 and that is at a distance from the first point determined by the ratio r1 /( r1 + r2 ).


© 1997 Apple Computer, Inc.

Previous | QD3D Book | Overview | Chapter Contents | Next |